/*-
 * Copyright (c) 1990, 1993
 *	The Regents of the University of California.  All rights reserved.
 * 
 * Portions copyright (c) 1999, 2000
 * Intel Corporation.
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 * 
 *    This product includes software developed by the University of
 *    California, Berkeley, Intel Corporation, and its contributors.
 * 
 * 4. Neither the name of University, Intel Corporation, or their respective
 *    contributors may be used to endorse or promote products derived from
 *    this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS, INTEL CORPORATION AND
 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS,
 * INTEL CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

// wide character version
// efi/lib/libc/wchar/iswctype.c


#include <wctype.h>
#include <ctype.h>

#undef iswalnum
int
iswalnum(wint_t wc)
{
	int c;

	c = (int) wc;
	return (__istype((c), _A|_D));
}

#undef iswalpha
int
iswalpha(wint_t wc)
{
	int c;

	c = (int) wc;
	return (__istype((c), _A));
}

#undef iswascii
int
iswascii(wint_t wc)
{
	int c;

	c = (int) wc;
	return ((c & ~0x7F) == 0);
}

#undef iswcntrl
int
iswcntrl(wint_t wc)
{
	int c;

	c = (int) wc;
	return (__istype((c), _C));
}

#undef iswdigit
int
iswdigit(wint_t wc)
{
	int c;

	c = (int) wc;
	return (__isctype((c), _D));
}

#undef iswgraph
int
iswgraph(wint_t wc)
{
	int c;

	c = (int) wc;
	return (__istype((c), _G));
}

#undef iswlower
int
iswlower(wint_t wc)
{
	int c;

	c = (int) wc;
	return (__istype((c), _L));
}

#undef iswprint
int
iswprint(wint_t wc)
{
	int c;

	c = (int) wc;
	return (__istype((c), _R));
}

#undef iswpunct
int
iswpunct(wint_t wc)
{
	int c;

	c = (int) wc;
	return (__istype((c), _P));
}

#undef iswspace
int
iswspace(wint_t wc)
{
	int c;

	c = (int) wc;
	return (__istype((c), _S));
}

#undef iswupper
int
iswupper(wint_t wc)
{
	int c;

	c = (int) wc;
	return (__istype((c), _U));
}

#undef iswxdigit
int
iswxdigit(wint_t wc)
{
	int c;

	c = (int) wc;
	return (__isctype((c), _X));
}

#undef towlower
wint_t
towlower(wint_t wc)
{
	int c;

	c = (int) wc;
	return ((wint_t)__tolower(c));
}

#undef towupper
wint_t
towupper(wint_t wc)
{
	int c;

	c = (int) wc;
	return ((wint_t)__toupper(c));
}

